package me.wangcai.onlinechat.controller;

import me.wangcai.onlinechat.utils.UserUtils;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

import javax.servlet.http.HttpServletRequest;

@Controller
public class IndexController {
    @GetMapping("/")
    public String getIndex(HttpServletRequest request){
        if(!UserUtils.isLogin(request)){
            return "redirect:login";
        }
        return "chat/chat";
    }
}
